package com.newdjk.newdoctor;

import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.tabs.TabLayout;
import com.newdjk.newdoctor.adapter.MyAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class GonggaoActivity extends AppCompatActivity {


    private static final String TAG = "GonggaoActivity";
    @BindView(R.id.head_iv)
    ImageView headIv;
    @BindView(R.id.nick_name)
    TextView nickName;
    @BindView(R.id.author_back)
    ImageView authorBack;
    @BindView(R.id.view_search_bg)
    TextView viewSearchBg;
    @BindView(R.id.iv_inner_search)
    ImageView ivInnerSearch;
    @BindView(R.id.top_cl)
    LinearLayout topCl;
    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.collapsing_toolbar)
    CollapsingToolbarLayout collapsingToolbar;
    @BindView(R.id.tab_l)
    TabLayout tabL;
    @BindView(R.id.app_bar_layout)
    AppBarLayout appBarLayout;
    @BindView(R.id.viewPager)
    ViewPager viewPager;
    private List<Fragment> fragmentList;

    private MyAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gonggao);
        ButterKnife.bind(this);
        fragmentList = new ArrayList<>();

        adapter = new MyAdapter(getSupportFragmentManager(), fragmentList);
        viewPager.setAdapter(adapter);
        tabL.setupWithViewPager(viewPager);
        tabL.getTabAt(0).setText("战绩");
        tabL.getTabAt(1).setText("能力");
        tabL.getTabAt(2).setText("资产");

        appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
            @Override
            public void onOffsetChanged(AppBarLayout appBarLayout, int i) {
                Log.d(TAG,""+i);
            }
        });

    }


}